<%@page import="com.blog.dao.UserDao"%>
<%@page import="com.blog.dto.Tag"%>
<%@page import="com.blog.dao.TagDao"%>
<%@page import="com.blog.dao.ArticleDao"%>
<%@page import="com.blog.dto.Article"%>
<%@page import="java.util.Vector"%>
<%@page import="com.blog.dto.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <title>article</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <link rel="icon" type="image/png" href="assets/i/favicon.png">
  <meta name="mobile-web-app-capable" content="yes">
  <link rel="icon" sizes="192x192" href="assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileImage" content="assets/i/app-icon72x72@2x.png">
  <meta name="msapplication-TileColor" content="#0e90d2">
  <link rel="stylesheet" href="assets/css/amazeui.min.css">
  <link rel="stylesheet" href="assets/css/app.css">
  <style type="text/css">
  .search-submit{
	margin: 0.15rem 0.15rem;
	line-height: 2.5rem;
	border: 1px solid #eee;
	padding: 0.2rem 0.8rem 0.2rem 0.8rem;
	text-align: center;
	background: #10D07A;
	color: #F3F3F3;
  }
  .search-submit:hover{
	  background: #10D07A;
	  color: #fff;
  }
  
  </style>
</head>

<body id="blog-article-sidebar">

<%
	Article article = new Article();
	ArticleDao articleDao = new ArticleDao();
	int article_id = Integer.parseInt(request.getParameter("article_id"));
	article = (articleDao.findArticleById(article_id)).get(0);
	String content = article.getContent();

%>
<!-- content srart -->
<div class="am-g am-g-fixed blog-fixed blog-content">
    <div class="am-u-md-8 am-u-sm-12">
      <article class="am-article blog-article-p">
        <div class="am-article-hd">
          <h1 class="am-article-title blog-text-center"><%=article.getTitle() %></h1>
          <p class="am-article-meta blog-text-center">
              <span><a href="javascript:;" class="blog-color">article &nbsp;</a></span>-
              <span><a href="<%=request.getContextPath() %>/searchServlet?act=author&keyword=<%=article.getAuthor() %>" style="color:#0e90d2;" > @<%=article.getAuthor() %> &nbsp;</a></span>-
              <span><%=article.getPublish_time() %></span>
          </p>
        </div>  
              
        <div class="am-article-bd">
        	<!-- 文章内容 -->
        	<%=content %>
        </div>
      </article>
        
        <div class="am-g blog-article-widget blog-article-margin">
          <div class="am-u-lg-4 am-u-md-5 am-u-sm-7 am-u-sm-centered blog-text-center">
            <span class="am-icon-tags"> &nbsp;</span>
            <%
          	  	String tags = article.getTag();
            	if(tags==null || tags.equals("") ){
            %>
           		<a href="<%=request.getContextPath() %>/searchServlet?act=tag&keyword=''">标签</a> 
            <%
            	}else {
            		String [] tagArr = tags.split(",");
            		for(String tt : tagArr){
            %>
           				<a href="<%=request.getContextPath() %>/searchServlet?act=tag&keyword=<%=tt %>"><%=tt %></a>&nbsp; 
            <%	
            		}
            	}
            %>
            
          </div>
        </div>

        <hr>
        <div class="am-g blog-author blog-article-margin">
          <div class="am-u-sm-3 am-u-md-3 am-u-lg-2">
            <img src="assets/i/f15.jpg" alt="" class="blog-author-img am-circle">
          </div>
          <div class="am-u-sm-9 am-u-md-9 am-u-lg-10">
          <h3><span>作者 &nbsp;: &nbsp;</span><span class="blog-color"><%=article.getAuthor() %></span></h3>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
          </div>
        </div>
        

        <hr>
    </div>

    
</div>
<!-- content end -->



<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>
<!-- <script src="assets/js/app.js"></script> -->
</body>
</html>